The present invention relates generally to transactional memory systems and more specifically to regulating speculative processing during execution of a transaction.
The number of central processing unit (CPU) cores on a chip and the number of CPU cores connected to a shared memory continues to grow significantly to support growing workload capacity demand. The increasing number of CPUs cooperating to process the same workloads puts a significant burden on software scalability. For example, shared queues or data-structures protected by traditional semaphores become hot spots and lead to sub-linear n-way scaling curves. Traditionally this has been countered by implementing finer-grained locking in software, and with lower latency/higher bandwidth interconnects in hardware. Implementing fine-grained locking to improve software scalability can be very complicated and error-prone, and at today's CPU frequencies, the latencies of hardware interconnects are limited by the physical dimension of the chips and systems, and by the speed of light.
Implementations of hardware transactional memory have been introduced, wherein a group of instructions—called a transaction—operate in an atomic manner on a data structure in memory, as viewed by other CPUs and an I/O subsystem (atomic operation is also known as “block concurrent” or “serialized” in other literature). The transaction executes optimistically without obtaining a lock, but the transaction may need to abort and retry executing if an operation of the executing transaction on a memory location conflicts with another operation on the same memory location. Speculative execution, or speculative processing, is a technique whereby a computing system performs a task, or begins processing instructions, that may not actually be needed. The purpose of speculative processing is to do work before it is determined whether that work will actually be needed, so as to prevent a delay that would have to be incurred by doing the work after it is determined whether it is needed. Again, if it turns out the work is not needed after all, any changes made by the work are reverted and the results are ignored.